UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'f1tv46u3DDu0dSMPP46AP3TYK/jsKWFqlNAWOMjf6QE=' 
WHERE 
  key_id = '60c3975e02de0a57a918eb1801afe856f9d1df5b434e947a195447657d42658b' 
  AND (
    token = 'f1tv46u3DDu0dSMPP46AP3TYK/jsKWFqlNAWOMjf6QE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016