UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SQTvU49Z2MmQ4SzpRqG4E5bztK0mJesn18Zu2XxoYNs='
WHERE
key_id = '75718a0e45822629ba2d31d141738d8c36a424d1eefec97a2e7b67c25d762ca4'
AND (
token = 'SQTvU49Z2MmQ4SzpRqG4E5bztK0mJesn18Zu2XxoYNs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)