UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nOD9fqzpS2DRgSoYVQe8+2T8iEGoJtmsSxCkEDzobVI='
WHERE
key_id = 'b255b6f20afd15bb528cf8e203ba80092ddf6dd80d8278c4b9318938555d8d56'
AND (
token = 'nOD9fqzpS2DRgSoYVQe8+2T8iEGoJtmsSxCkEDzobVI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)