UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2ue9gggIYhgLRTedNEiBTWGiin5zJgqrZyLskWWcL0A='
WHERE
key_id = '1919c2ccdbb9e28c52f3d6694390d2e1c9adccfc5a8e614dad1304ddf5e96834'
AND (
token = '2ue9gggIYhgLRTedNEiBTWGiin5zJgqrZyLskWWcL0A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)