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