UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cnNSYh2HbbZkrvXt81M+kaLm829F6a5WI/55apBKaEY='
WHERE
key_id = '435cf8271ca4c5af3343d3ca4df080e8d64515e96394ab4c5fb424e9c87a3451'
AND (
token = 'cnNSYh2HbbZkrvXt81M+kaLm829F6a5WI/55apBKaEY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)