UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nhIAtVt5DB+zD9cY+Gu1e3/2NoIFORge3Brm+pM/xak=' 
WHERE 
  key_id = 'ff40c8e4a6748912c8465df7aebed7884860293c73eef1459eeb39f49b7a219a' 
  AND (
    token = 'nhIAtVt5DB+zD9cY+Gu1e3/2NoIFORge3Brm+pM/xak=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022