UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YVj/zD0FLTifzIpi2dorIqiPVJUrr29LjliJ5WH+f/E='
WHERE
key_id = '9eb2206602a9bd0b6873181b7f42c573f712cd9f0181dfe02e8a54f4cccdfe1b'
AND (
token = 'YVj/zD0FLTifzIpi2dorIqiPVJUrr29LjliJ5WH+f/E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)