UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8MajjNfFccUMgxcT5IITGY55/s1bmRwLwqclG3PqHAQ=' 
WHERE 
  key_id = '1ff04065e111407f5f05529c58c5e51ebefd231f5e0cc4303897f98d5e47a79b' 
  AND (
    token = '8MajjNfFccUMgxcT5IITGY55/s1bmRwLwqclG3PqHAQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00086