UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BEwPK9SHQgb8OljECMdYJulaC/gqydExc7SrEt0Pjsg='
WHERE
key_id = '07af483a48afa344f5bffc90d32d3ee801c5ab0d181ec8d4800635df4caa571f'
AND (
token = 'BEwPK9SHQgb8OljECMdYJulaC/gqydExc7SrEt0Pjsg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)