UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uGrH0GSukdjZfpiRLp887AlpB8IX6CrjRnevvH5aaBc='
WHERE
key_id = '61541f5c3d3a671763bf96b619a1330745d2cb1ce78fe2c64b5a222b18452448'
AND (
token = 'uGrH0GSukdjZfpiRLp887AlpB8IX6CrjRnevvH5aaBc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)