UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+9rxWWe8SqpU42Jg/hzyCE9Hf4UHCwGW3cET7uhFZ1s=' 
WHERE 
  key_id = 'a6aa5eb2386124990c183d98884247cd071fb6dc6e35c95e29494973ce42908b' 
  AND (
    token = '+9rxWWe8SqpU42Jg/hzyCE9Hf4UHCwGW3cET7uhFZ1s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015