UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VklR/35b200MiuWWKqDp2AJaTSUW2n/nJaF0BBS2Rwo=' 
WHERE 
  key_id = '5755bcf681f604fffd50fb1d84c693c6f781744f854972b1623abd34ff56fa42' 
  AND (
    token = 'VklR/35b200MiuWWKqDp2AJaTSUW2n/nJaF0BBS2Rwo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029