UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kkLNr+xYeQCbDCw7mhyTbX5N9LcwIOBVCuAj2arNFmg='
WHERE
key_id = '418b2ff9729f7cf0ff6f8b9b464db20c28f295141ea42c3cc6c485d5ad79d0b7'
AND (
token = 'kkLNr+xYeQCbDCw7mhyTbX5N9LcwIOBVCuAj2arNFmg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)