UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Wqvk8ME3LYzAqeDk5OdL/OtYKjh++YdV3Od1ntqXIy0='
WHERE
key_id = 'b90296600c65ef5952342267cd0a4acfe28746eb9ef12bfac3c0ff18fa5c87fe'
AND (
token = 'Wqvk8ME3LYzAqeDk5OdL/OtYKjh++YdV3Od1ntqXIy0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)