UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KXjd6IXpvp/dXLQSUPm/KjlsUCiVbUZq2M6bvtEWAAw='
WHERE
key_id = '4169c9efe872c6ff5a11c45b56906a58552d614d7fb3f79cec9314ea4d4e5c01'
AND (
token = 'KXjd6IXpvp/dXLQSUPm/KjlsUCiVbUZq2M6bvtEWAAw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)