UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0PwwpGQGej+ABdVVSgCtDg8J82jSHw0yIJGyPNTrX3U='
WHERE
key_id = '7e5eec883d1226e5b2fc7d11074d7d39704f5f9bb471c1316e763e6be3526435'
AND (
token = '0PwwpGQGej+ABdVVSgCtDg8J82jSHw0yIJGyPNTrX3U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)