UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UvxjLwfU+1oNl7u2tgObxlMZc50SoIdQHCGopcBiPpI='
WHERE
key_id = 'ea2d28c2843aad393501391f2bf1fbb80b8e9a4f1af71b2273e5841ff4f68f4b'
AND (
token = 'UvxjLwfU+1oNl7u2tgObxlMZc50SoIdQHCGopcBiPpI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)