UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gTbcrxUcPXbecK3UOxbRsWuhPeLw6ZUoJkwR0HrJ1UQ='
WHERE
key_id = '8cc67c26de7c596cfb38142afd43fd198d32b1dec92c6520833930b1e67944c0'
AND (
token = 'gTbcrxUcPXbecK3UOxbRsWuhPeLw6ZUoJkwR0HrJ1UQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)