UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vslKZQp2k886Fdv2DQLzPmz7vMBgWCPi9lHmCUoMJM0='
WHERE
key_id = 'ff9b0d9fc92d103981936adb7a979f0dbb70688216b77f20fe4c344f5e26cff2'
AND (
token = 'vslKZQp2k886Fdv2DQLzPmz7vMBgWCPi9lHmCUoMJM0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)