UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JQySk1UgqAKCi4TgGvD/+bbDhz7wfjt63ofmJEyhA68='
WHERE
key_id = 'c79f0998b3745828fdf0269f71e78a3556575b85a5b9c1c6bbdee407fd760713'
AND (
token = 'JQySk1UgqAKCi4TgGvD/+bbDhz7wfjt63ofmJEyhA68='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)