UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mhZjjbpm6a0SvPHDo6lFz/7pf744oljI4iaTBR6Wduw=' 
WHERE 
  key_id = 'f2bf3e8ff100eaa115dd8a3b88baf01e367dd0931eef9720ae506c948d913758' 
  AND (
    token = 'mhZjjbpm6a0SvPHDo6lFz/7pf744oljI4iaTBR6Wduw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021