UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gEf3rigKUC3mlvtucMlJGoKXoclH1/j8oTXLGtM9QCM='
WHERE
key_id = '996f05547f2ebf184e1fffeca397a118a19b9017384ee0fa8da78ba9fb3ec491'
AND (
token = 'gEf3rigKUC3mlvtucMlJGoKXoclH1/j8oTXLGtM9QCM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)