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