UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tSVI7ZBix4zWhOWy7F8qww6Szg8h2IKrHNcbeOeBj+c='
WHERE
key_id = 'c49890dc5218d4bbdebea2024cce0612076eca38165fd716053140bb8183d9b8'
AND (
token = 'tSVI7ZBix4zWhOWy7F8qww6Szg8h2IKrHNcbeOeBj+c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)