UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+oKZ8JXmd3hp4cAqpsnyZb7co02jcEu1aNxc9LqUt8A=' 
WHERE 
  key_id = '850d2596918e61a0c73a338effd5a4e79768579bbf95972e0158903c18dc0e13' 
  AND (
    token = '+oKZ8JXmd3hp4cAqpsnyZb7co02jcEu1aNxc9LqUt8A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029