UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Rnygrzi3Jr/p6kRvMqhJcvABFvjI7ZolTbqx2W6HwMU='
WHERE
key_id = 'ffe8bd8d656cf1fa754fc3c82af4b858cdd853ab5cb5275dc7ca6ec4fd9a32e9'
AND (
token = 'Rnygrzi3Jr/p6kRvMqhJcvABFvjI7ZolTbqx2W6HwMU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)