UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SccWXrI1XSi+SywoZb8Zhk5aHY1SLd7MxfEj2kqFbq0=' 
WHERE 
  key_id = '4e736a2f3d63e9664a3fa320fe80ed79942f57f0a6dffc9a7c02f2b9a0113dec' 
  AND (
    token = 'SccWXrI1XSi+SywoZb8Zhk5aHY1SLd7MxfEj2kqFbq0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038