UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't7E2cT/osbrXdz/QVGkA2qyNwOjTkhFjS/82iGShcmM='
WHERE
key_id = 'b7c696e2c62a089691575b3d0f55262a481bda0d7dde5a3103a1d1cd418a7d20'
AND (
token = 't7E2cT/osbrXdz/QVGkA2qyNwOjTkhFjS/82iGShcmM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)