UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yWx+tTE42EnFK/AjTJf+pBAdN1sbI1E3Og21+5LGaO4='
WHERE
key_id = '7174510eb781efb3e30577304c2adb4f788a5caee532690b33856499fb6cd24d'
AND (
token = 'yWx+tTE42EnFK/AjTJf+pBAdN1sbI1E3Og21+5LGaO4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)