UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sBk553zf4TMiCPjbAdOEKAEEGempffr+/FTVdjn7W78=' 
WHERE 
  key_id = 'cff9fd1e80d815a1a3c99522862ab8124087cff2087308d7a18fb7776d52b226' 
  AND (
    token = 'sBk553zf4TMiCPjbAdOEKAEEGempffr+/FTVdjn7W78=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030