UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8/NSeQNZWzwTArskjMyyDAfPzdjxpoH8KIRaPSYXHlo='
WHERE
key_id = '52be9fc1f4814914f4f5955b4e7d16998971ea1b0d5128432de9e10093b0b9bb'
AND (
token = '8/NSeQNZWzwTArskjMyyDAfPzdjxpoH8KIRaPSYXHlo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)