UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '98mzE02C7JOKR14zgZVHjTcNOjLnKSB/V+1Ce7IHJZ8='
WHERE
key_id = '66782f312481b0062b2ac05c6269c556986581ef101e95e54b78c96ca81d1f77'
AND (
token = '98mzE02C7JOKR14zgZVHjTcNOjLnKSB/V+1Ce7IHJZ8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)