UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'knB8hyAWGy9tAbmPZ9F7CHdlUR7g1x62G77cu2X9tsA='
WHERE
key_id = '3b19f1e1d693f15d02a42dd1972627a56759db1b78dfcd0faf65794ffc746792'
AND (
token = 'knB8hyAWGy9tAbmPZ9F7CHdlUR7g1x62G77cu2X9tsA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)