UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JlQ7nvsR/l8R2iQZczNZNyP2BKOeu8LihBz34UaEoIc=' 
WHERE 
  key_id = 'fa1435eb0d6b45747699f9ad2ca86d723af5481c797d76b3484bce5b06119896' 
  AND (
    token = 'JlQ7nvsR/l8R2iQZczNZNyP2BKOeu8LihBz34UaEoIc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026