UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'x6NHbu/V39DjJYSRss8VFmyEJmDYDVWGBjfT3GeYe1Y='
WHERE
key_id = 'dccbcec3a11a8c581aa92644f07069ef272e4207ab599b0fe2ddc3d5409a271a'
AND (
token = 'x6NHbu/V39DjJYSRss8VFmyEJmDYDVWGBjfT3GeYe1Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)