UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UMvFacvetqcOMPBeMwRN29gH++RorlntCgRGwAsUB1w='
WHERE
key_id = 'd8d938f7cef9b0a57d6e12a45460f34e67207db131b773aa63d17a73062bfe0f'
AND (
token = 'UMvFacvetqcOMPBeMwRN29gH++RorlntCgRGwAsUB1w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)