UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bVs6wWbEgTxPWaCHm9U2pp65oElFhmADiAHbpswQ7c0='
WHERE
key_id = '85c11af97616a36b300b3ae1743a8006f0220831c9bc60039c86ec2d9af86d9e'
AND (
token = 'bVs6wWbEgTxPWaCHm9U2pp65oElFhmADiAHbpswQ7c0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)