UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LLOwKm2K5eOsvjEyfH47IkEOkjNPNswvt82pvMvmKtA='
WHERE
key_id = 'e72d358b0cb9ec50eb1e36b0a18c665f0ed26b0cb6b8915163697339e129aa26'
AND (
token = 'LLOwKm2K5eOsvjEyfH47IkEOkjNPNswvt82pvMvmKtA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)