UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6Z1oTAmmVC5ik/PruqmHA/h8SA/SAfUzIQFEeQQB16Q=' 
WHERE 
  key_id = '412cf58d5400a3f7c322fabbe10859e83524d420bedf5ebe174f0219d23af0df' 
  AND (
    token = '6Z1oTAmmVC5ik/PruqmHA/h8SA/SAfUzIQFEeQQB16Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00077