UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'un9Tkw0Wzs5zXGbY/NHUAVwK1R4fylkwEATT6h5hCYg=' 
WHERE 
  key_id = '34b69fbb6b01b893bd8d9455d6dd0a32b622629fd5c058d7c71fb15f9288422f' 
  AND (
    token = 'un9Tkw0Wzs5zXGbY/NHUAVwK1R4fylkwEATT6h5hCYg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025