UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xBIaZt4gkB4/f/6IxRu7uGd8NC9Lyo3Lph4p1ZNFGm0=' 
WHERE 
  key_id = 'f54ad1ac5e0ab8f0d808da585378370fdad9e070c526d86f2de5b0813f1687e2' 
  AND (
    token = 'xBIaZt4gkB4/f/6IxRu7uGd8NC9Lyo3Lph4p1ZNFGm0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038