UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SUgS+tuGnkE1Nq7jrR0c5f+NCCL1K+ElFrL8heWOLQQ='
WHERE
key_id = '8e7ab9c578a83f833316c365081a886470f4bf0a23bc8ded1ef5c37d14d6df6b'
AND (
token = 'SUgS+tuGnkE1Nq7jrR0c5f+NCCL1K+ElFrL8heWOLQQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)