UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'W35AeSQcahHa7eWltibVRnvzFmZAsRV7nlUNsjO0fdQ='
WHERE
key_id = 'ced6126281a9e7feb5008df05f14563fd36961ca4d7ab0b37168b9ffc36a114f'
AND (
token = 'W35AeSQcahHa7eWltibVRnvzFmZAsRV7nlUNsjO0fdQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)