UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Y0+fpEWK1aN0/38WnrGXdABxll72LLA7zFxn5/1bf8A='
WHERE
key_id = 'c43641acb1d2fba328871e56fdc2708007fd2e60125731ae3937afeca726cc6a'
AND (
token = 'Y0+fpEWK1aN0/38WnrGXdABxll72LLA7zFxn5/1bf8A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)