UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lEFM+WJWQZfcrWB7Jl3UnJVNzs5dr7cG81eBpaG5+KA='
WHERE
key_id = '823e0e9f8173c21d8c651cb5288a8c37235dc5589a08207224e095c2d85bb98c'
AND (
token = 'lEFM+WJWQZfcrWB7Jl3UnJVNzs5dr7cG81eBpaG5+KA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)