UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1+NuWJvYIXgvUSM8u89S7NfD24jhQicpqfb3vDSwGTw=' 
WHERE 
  key_id = '47707bad2a9f5be3dfce86f10048be82258f687b37c214ea73aae9dcdc04e59e' 
  AND (
    token = '1+NuWJvYIXgvUSM8u89S7NfD24jhQicpqfb3vDSwGTw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00069