UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uuI7BhxnmI396umisKn41qRKf+cMBWGunx8qwPQQEKo='
WHERE
key_id = 'b3bd068e310c1d976bc4841a01a40f8753a5725d679531c0a32ab6a858a6f1c9'
AND (
token = 'uuI7BhxnmI396umisKn41qRKf+cMBWGunx8qwPQQEKo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)