UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'scjfoW06hR8McSSrb/Yqm027ItYO2Cvyt0Dpo76c1CI='
WHERE
key_id = '5fa8cbfac77cb21404b4f0a66fef3cc376fbee41c41232a31eecfa23c927daa2'
AND (
token = 'scjfoW06hR8McSSrb/Yqm027ItYO2Cvyt0Dpo76c1CI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)