UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+PLfC0uJxLT6vs48nTybnkwoegyra4lAU2ZxfX8Pjzw=' 
WHERE 
  key_id = 'fb77af4576cb8b3cdcb2194613de6c4dbc061736df6ef0faca3cb3afefae38fa' 
  AND (
    token = '+PLfC0uJxLT6vs48nTybnkwoegyra4lAU2ZxfX8Pjzw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020