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