UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WsQ+0mIC7R/MlGRV/0yJhOXJAUEWQfb4ke8TMHJdgx0=' 
WHERE 
  key_id = '41e5517af5422c1d8f9724ee223b96724933f95a6a2da5f6b0aa274a96d72339' 
  AND (
    token = 'WsQ+0mIC7R/MlGRV/0yJhOXJAUEWQfb4ke8TMHJdgx0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022