UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lqfL7aC6nGOh5KclkNMrwc4tR+ozyMj79W6CcYJ2Dt8=' 
WHERE 
  key_id = 'ee2eea021d356adfe7e94ec8a4a4824515a8c63d7f220c5f57931f731185f2a9' 
  AND (
    token = 'lqfL7aC6nGOh5KclkNMrwc4tR+ozyMj79W6CcYJ2Dt8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032