UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ggOpRuHV6PP5BVukjHKgoaVnf4nOm2hetGy2+Yx1Ka8='
WHERE
key_id = '86e08e8212b771429d707d628364ee6892c430c692bb2d5a0c68e311cd26fbf5'
AND (
token = 'ggOpRuHV6PP5BVukjHKgoaVnf4nOm2hetGy2+Yx1Ka8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)