UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UGYxgl1MSkNTev5oyHQC1FQp3u5OxYBRtzn56eEotgU='
WHERE
key_id = 'f822149dedf1fd2957ca7f7febc9559dc3381dc3752392697a71d1875f6ba216'
AND (
token = 'UGYxgl1MSkNTev5oyHQC1FQp3u5OxYBRtzn56eEotgU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)